/**
 * create 2-9-17
 */

function registerService($http){
    
    
        function register(formData,callback){
            // var postData = {
            //     "username":user.username,
            //     "password":user.password
            // };
            // var config = {
    
            // };
            // console.log(postData);
            // $http.post("o2o/customer/register",postData,config)
            $http({
                method: 'POST',
                url: '/o2o/customer/register',
                data: formData,
                headers: {
                    'Content-Type': undefined
                }
            }).then(function(res){
                console.log(res.data);
                callback(null,res.data);
            })
            .catch(function(err){
                console.log(err);
                callback(err,null);
            });
        }
         return {
            register : register
        }
    }
    
    module.exports = registerService;